<template>
    <RouterView/>
    <van-tabbar v-model="active">
        <van-tabbar-item 
        v-for="item in router.options.routes[0].children" 
        :key="item.path" 
        :icon="item.meta.icon"
        :url="`#/${item.path}`"
        >{{item.meta.name}}</van-tabbar-item>
    </van-tabbar>
</template>

<script setup>
import { onMounted, ref } from 'vue';
import {  RouterView, useRoute, useRouter} from 'vue-router'
const route = useRoute()
const router = useRouter()
const active = ref(0)
onMounted(()=>{
    console.log(router,'router')
    const data = router.options.routes[0]
    data.children.findIndex(item =>'/' + item.path ===route.path)
})

</script>

<style scoped></style>
